package com.example.domain.convert;

import com.example.domain.dto.UserDTO;
import com.example.domain.entity.User;
import com.example.domain.vo.UserVO;
import org.mapstruct.Mapper;
import org.mapstruct.BeanMapping;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;

import java.util.List;

@Mapper(componentModel = "spring")
public interface UserConvert {

    User toEntity(UserDTO dto);

    UserVO toVO(User entity);

    List<UserVO> toVOList(List<User> list);

    @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
    void updateEntity(@MappingTarget User entity, UserDTO dto);
} 